package com.example.blogdemo1.mapper;

import com.example.blogdemo1.common.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/*
 * @author zzr
 * @date: 2025/10/05  18:23
 * @description:
 */

@Mapper
public interface UserMapper {

    /**
     * 根据用户名，查询用户信息
     * @param userName
     * @return
     */
    @Select("select * from user_info where delete_flag = 0 and user_name = #{userName}")
    UserInfo selectByName(String userName);

    /**
     * 根据用户 id  查询用户信息
     * @param id
     * @return
     */
    @Select("select * from user_info where delete_flag = 0 and id = #{id}")
    UserInfo selectById(Integer id);
}
